The Reaper V1.21
Freeware ©1999 AKUA interactive media AG.
All rights reserved.
Released: 14. February, 1999.

Don’t fear...
The Reaper allows you to control the heap allocation for applications that you may not otherwise adjust. Examples are CD-ROM applications, the Finder and Background applications.

It also features a RAM Charger like expansion of the heap of applications you choose.

Requirements?
System 7.0 is the minimum needed. It has only been tested on System 8.51 for PowerMacs and System 7.61 on 68K Macs. If you want it to run on some system and it doesn't, just let me know and I'll fix it.

Examples
Case 1
I use AppleWorks a lot. Sometimes when printing digital photos, it needs 20 MB, with normal work it needs 3 MB - so why have to switch back & forth? With “Smart Heap”, AppleWorks will expand into available RAM when it needs it.

Case 2
We just got an iMac for our son. When he runs some of his CD-ROMs and tries to print to the Epson 740, some programs alert that there is not enough RAM to print - duh, the iMac has 96 MB. But CD-ROM based applications have unadjustable heaps.
Enter The Reaper, with a little adjustment, it can boost the heap of the CD-ROM app by whatever is needed.

Terms
Temporary Memory - This is the memory not being used by any application. There is at least as much temporary memory available on your system as is shown in the “Largest Free Block” field of the “About this Macintosh…” window in the Finder. Maybe more.

Options
Choose an application to configure in the “Settings for” menu. If it is not in there, drag it to The Reaper’s window. It will subsequently be added and chosen. 

The first entry in the application menu is a “catch all” for any application that is not opened “read-only”. If not set individually, applications will default to the expansion set for this item.

The second entry in the application menu is a “catch all” for any application that is “read-only”. This includes all shared applications and CD-ROM (or locked volume) based applications. If not set individually, these applications will default to the expansion set for this item.

Thus, one can just set The Reaper’s second item at 25% or 512K or whatever to achieve a larger heap for all CD-ROM applications.

Remove
Removes the displayed Application from the settings. (The first two items can not be removed, set them to 0% to disable them). Clear from the Edit menu does the same.

Expand Heap by
This option sets how much to expand the allocated heap for the application displayed in the “Settings for” menu. You can choose a %age of its setting, or a fixed amount. For example, 100% will allocate double the setting shown in the Finder (Original + 100% expansion). 512K will allocate another 512 kilobytes.

Only if on Read-Only Volume
This will only expand the heap if the application is launched from a read-only volume (e.g. CD-ROM or locked volume).

Recognize by Name
By default, The Reaper will act on any application with the creator code of the application dropped on it (i.e. All Director projectors would need only one setting). Choosing “Recognize by Name” will only act on an application of the same name.

Allow Heap Growth 
This option provides RAM Charger like expansion of the heap by returning “temporary” memory if the application’s allocated heap is full and a request to allocate memory fails. This will probably not work for a lot of applications. Either ignore it or use it sparcely and test it before doing something productive with the application.

Smart Heap 
This option causes handles - that are either used when a picture is being recorded or that are bigger than 1/4th of the free heap space - to be allocated in the heap with the most free space. (Temporary Memory or the Application Heap). It is useful for applications like AppleWorks that you sometimes want to move pictures into, but mostly use for word processing. When a picture is inserted in a document, it will be stored in temporary memory - unless TempMem is full, then it will go to the app heap.

Since AppleWorks stores a picture for every window, this will allow insertion of pictures into a 2500K AppleWorks partition (provided your System has enough RAM). The previews will be stored in Temporary Memory when they don’t fit into the Application’s allotted space.

What else?
If, of course, the RAM calculated by “Expand Heap by” is not available, the System will act as it normally does when you launch a program in limited RAM space.

Technical?
The Reaper wrapper patches _Launch, watching for a Get1Resource(‘SIZE’,…) while inside that trap. When a request for a SIZE is caught, The Reaper adjusts the values according to the settings if there are any applicable.

When searching for a preference match, The Reaper first searches all “by Name” entries, then falls back to the default creator match.

Preferences are stored in the file itself, thus permitting distributed settings in one file, but prohibiting settings modifications if run from a read-only volume. This can be changed if someone wants it. I will probably add an “Import Settings…” to V1.3.

Expand Heap wraps NewHandle and watches for an error. When it occurs, it will try TempNewHandle() to get the RAM>

Smart Heap wraps NewHandle with an alternate routine that checks the free bytes of the heap and goes to the heap with the most free space when the requested block is > 1/4 of available app heap or the request is within a call to OpenPicture.

The source code of the TRAP resources is provided for your learning / reaping. Plagiarize it as you wish.

Can I distribute it?
Yes. The Reaper is free. If you use The Reaper in an environment that is commercially viable (e.g. Kiosks you are being paid for, in a business environment where the Reaper makes you work more efficiently), you should consider licensing for $14.96 and registering it for free support and e-mailed updates. I can’t take credit cards - I’ll probably have to go to Kägi for that... Let me know if you are interested.

Who wrote it?
For questions, comments, or to let me know you hate The Reaper and think it is worthless, contact:

Gregory Lemperle-Kerr
AKUA interactive media AG
akua@bluewin.ch - maybe akua@access.ch by mid 1999
.

History
14.Feb.99

V1.21
+ Added checks to avoid allocating a system heap handle in Temporary Memory - which caused some occasional crashes in Smart or Growth heaps.
+ Clear handles requested as clear when allocated from Temp Memory.
+ No longer check the Twitcher Zone for free space - since it is not always accurate in MacOS 8.x and always inaccurate in MacOS 7.x.

03.Feb.99

V1.2
+ Improved “Smart Heap” option (check for AppHeap).
+ Tested and fixed for System 7.61 on 68K machines.

31.Jan.99

V1.1
+ Added “Smart Heap” option.
+ Fixed display of icon at startup.

15.Jan.99

V1.0
+ First release.